package com.liugh.entity.standard;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;

/**
 * 留言
 */
@Builder
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("standard_message")
public class StandardMessage extends Model<StandardMessage> implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private int id;

    /**
     * 用户编号
     */
    @TableField("user_no")
    private String userNo;

    /**
     * 留言内容
     */
    @TableField("content")
    private String content;

    /**
     * 留言时间
     */
    @TableField("create_time")
    private Date createTime;


    /**
     * 用户名，数据库中没有
     */
    @TableField(exist = false)
    private String userName;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
